Component({
  mixins: [],
  data: {
  },
  props: {
    onPopClose: (data) => console.log(data),
    showTicket: false,
    tickets: []
  },
  didMount() {
  },
  deriveDataFromProps(nextProps) {
  },
  didUpdate() {
  },
  didUnmount() {
  },
  methods: {
    popClose(e) {
      let checkTicket = {}
      checkTicket.id = ''
      checkTicket.name = '不使用优惠券'
      checkTicket.amount = 0
      this.props.onPopClose(checkTicket);
    },
    radioChange: function (e) {
      console.log(e)
      const ticketId = e.detail.value
      const tickets = this.props.tickets
      let checkTicket = {}
      if (ticketId) {
        const currentTicket = tickets.filter((value, index) => {
          return value.id == ticketId
        })
        checkTicket.id = ticketId
        checkTicket.name = currentTicket[0].name
        checkTicket.amount = currentTicket[0].amount
      }else{
        checkTicket.id = ''
        checkTicket.name = '不使用优惠券'
        checkTicket.amount = 0
        console.log('不用去年----------')
      }
      this.props.onPopClose(checkTicket);
    },
     ticketClose(){
      this.props.onPopClose();
     }
  },
});